<!DOCTYPE HTML>
<html>
<head>
<title>IdlInterface.prototype.has_to_json_regular_operation()</title>
</head>
<body>
<div id="log"></div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<script src="../../../idl-helper.js"></script>
<script>
    "use strict";
    test(function() {
        var i = interfaceFrom('interface A { };');
        assert_false(i.has_to_json_regular_operation());
    }, 'should return false when the interface declares no toJSON operation.');

    test(function() {
        var i = interfaceFrom('interface A { static object toJSON(); };');
        assert_false(i.has_to_json_regular_operation());
    }, 'should return false when the interface declares a static toJSON operation.');

    test(function() {
        var i = interfaceFrom('interface A { object toJSON(); };');
        assert_true(i.has_to_json_regular_operation());
    }, 'should return true when the interface declares a regular toJSON operation.');
</script>
</body>
</html>
